<#include "header.ftl">

<#-- 商品详情页  -->
<script type="text/javascript" src="../../resources/js/show.js"></script>

<div class="g-doc" ng-controller="showcontroller">
    <div class="n-show f-cb" id="showContent">
        <div class="img" ng-cloak><img src="{{detail.picture}}" alt="" ></div>
        <div class="cnt">
            <h2 ng-bind="detail.name"></h2>
            <p class="summary" ng-bind="detail.summary"></p>
            <div class="price">
                <span class="v-unit">¥</span><span class="v-value" ng-bind="detail.price"></span>
            </div>
            <div class="num">购买数量：<span class="lessNum"><a ng-click="number=number>0?number-1:number" >-</a></span><span class="totalNum" ng-bind="number"></span><span class="moreNum"><a ng-click="number=number+1">+</a></span></div>
            <div class="oprt f-cb">
                    <button class="u-btn u-btn-primary"  ng-if="userOfLoger.name == 'buyer' && !detail.isSelled" ng-click="addCartModal()">
                                                  加入购物车</button>
                       <span class="u-btn u-btn-primary z-dis" ng-if="userOfLoger.name == 'buyer' && detail.isSelled">已购买</span>
                    <span class="buyprice" ng-if="userOfLoger.name == 'buyer' && detail.isSelled" >当时购买价格：{{selledPrice}}</span>                            
                    
                    <a href="/edit?id={{detail.id}}" class="u-btn u-btn-primary"  ng-if="userOfLoger.name == 'seller' ">编 辑</a>                       
           			<span class="buyprice" ng-if="userOfLoger.name == 'seller' && detail.isSelled" >已售出数目：{{selledNumber}}</span>                            
                    
            </div>
            
        </div>
    </div>
    <div class="m-tab m-tab-fw m-tab-simple f-cb">
        <h2>详细信息</h2>
    </div>
    <div class="n-detail"  ng-bind="detail.description"></div>
    
     <div class="modal fade" id="modalid-add-show">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <p>确认加入购物车吗?</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="addCart()">确定</button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    
</div>



<#include "footer.ftl">